package com.maven.demo.task;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledFuture;

import com.maven.demo.core.common.SpringBeanUtil;
import com.maven.demo.model.pojo.User;
import com.maven.demo.service.UserService;

@SuppressWarnings("rawtypes")
public class UserTask {
	
	private static Map<Integer, List<ScheduledFuture>> scheduledMap = new HashMap<Integer, List<ScheduledFuture>>();
	
	static {
		if(scheduledMap.size() == 0) {
			UserService userService = SpringBeanUtil.getBean("userService");
			List<User> users = userService.selectAllUsers();
			for (User user : users) {
				System.out.println(user.getUserName() + "--" + user.getUserEmail());
			}
			System.out.println("进来了");
		}
	}

	public static Map<Integer, List<ScheduledFuture>> getScheduledMap() {
		return scheduledMap;
	}
}
